<?php 

$userna=$_POST['qqusrename'];
$passd =$_POST['qqpassword'];

$db = file_get_contents('./Db/yonghu.txt');

$db = json_decode($db,true);

for ($i=0; $i < count($db); $i++) { 
	if($userna==$db[$i]['username'] && $passd==$db[$i]['password']){		
	
		session_start();
		$_SESSION['zhanghao']=$db[$i]['username'];
		
		$arr=array(
			'error'=>0,
			'info'=>'登录成功'
			);
		echo json_encode($arr);
		exit;
	}
	
}

$arr=array(
		"error"=>1,
		'info'=>"登录失败"
		);
echo json_encode($arr);exit;













 ?>